iT邦幫忙

DAY 28
0

從最底層基礎建設到軟體開發,無所不包的雲端系列 第 28

從最底層基礎建設到軟體開發,無所不包的雲端(Openstack Day 19)

  • 分享至 

  • xImage
  •  

由於Nova 的部分 比較複雜 將會分為幾天來做教學

首先 我們先需要一個Controller Node 來做虛擬機器的管理

所以,今天就讓我們先來安裝Controller node吧

  1. Install Compute controller services on controller node

apt-get install -y nova-api nova-cert nova-conductor nova-consoleauth nova-novncproxy nova-scheduler python-novaclient nova-compute-kvm python-guestfs nova-network

(若使用qemu,請改裝nova-compute-qemu,並修改nova.conf)

設定libguestfs0 : Create or update supermin appliance now? (是)

rm /var/lib/nova/nova.sqlite

dpkg-statoverride --update --add root root 0644 /boot/vmlinuz-$(uname -r)

modprobe kvm_intel

nano /etc/libvirt/qemu.conf (modify)

user = "root"

group = "root"

cgroup_device_acl = [

"/dev/null", "/dev/full", "/dev/zero",

"/dev/random", "/dev/urandom",

"/dev/ptmx", "/dev/kvm", "/dev/kqemu",

"/dev/rtc", "/dev/hpet","/dev/net/tun"

]

service libvirt-bin restart

  1. Configure Compute controller services on controller node

nano /etc/nova/nova.conf (清空檔案再新增內容)

[DEFAULT]

#force_config_drive=true

verbose=True

logdir=/var/log/nova

state_path=/var/lib/nova

lock_path=/var/lock/nova

rootwrap_config=/etc/nova/rootwrap.conf

root_helper=sudo nova-rootwrap /etc/nova/rootwrap.conf

rpc_backend=rabbit

rabbit_host=[Controller_IP]

rabbit_password=RABBIT_PASS

bindir=/usr/bin

GLANCE

image_service=nova.image.glance.GlanceImageService

glance_api_servers=[Controller_IP]:9292

NOVA

nova_url=http://[Controller_IP]:8774/v1.1/

connection_type=libvirt

compute_driver=libvirt.LibvirtDriver

compute_scheduler_driver=nova.scheduler.filter_scheduler.FilterScheduler

instance_name_template=instance-%08x

api_paste_config=/etc/nova/api-paste.ini

libvirt_use_virtio_for_bridges=True

osapi_compute_extension=nova.api.openstack.compute.contrib.standard_extensions

ec2_dmz_host=[Controller_IP]

s3_host=[Controller_IP]

enabled_apis=ec2,osapi_compute,metadata

allow_resize_to_same_host=True

resume_guests_state_on_host_boot=True

start_guests_on_host_boot=False

Networking

network_api_class = nova.network.api.API

security_group_api = nova

network_manager=nova.network.manager.FlatDHCPManager

firewall_driver=nova.virt.libvirt.firewall.IptablesFirewallDriver

dhcpbridge=/usr/bin/nova-dhcpbridge

dhcpbridge_flagfile=/etc/nova/nova.conf

force_dhcp_release=True

network_size=254

allow_same_net_traffic=False

send_arp_for_ha=True

share_dhcp_address=True

flat_network_bridge=br0

flat_interface=eth0

public_interface=eth1

fixed_range=192.168.1.0/24

VOVNC CONSOLE

my_ip=[Controller_IP]

novncproxy_base_url=http://[Controller_IP]:6080/vnc_auto.html

vncserver_listen=[Controller_IP]

vncserver_proxyclient_address=[Controller_IP]

Cinder

volumes_path=/var/lib/nova/volumes

volume_api_class=nova.volume.cinder.API

volume_driver=nova.volume.driver.ISCSIDriver

volume_group=cinder-volumes

volume_name_template=volume-%s

iscsi_helper=tgtadm

auth_strategy=keystone

[keystone_authtoken]

auth_host=[Controller_IP]

auth_port=35357

auth_protocol=http

auth_uri=http://[Controller_IP]:5000

admin_tenant_name=service

admin_user=nova

admin_password=NOVA_PASS

signing_dirname=/tmp/keystone-signing-nova

[database]

connection=mysql://nova:NOVA_DBPASS@[Controller_IP]/nova

[libvirt]

libvirt_type=kvm

建立For Nova的表格

mysql -u root -p

CREATE DATABASE nova;

GRANT ALL ON nova.* TO 'nova'@'%' IDENTIFIED BY 'NOVA_DBPASS';

GRANT ALL ON nova.* TO 'nova'@'localhost' IDENTIFIED BY 'NOVA_DBPASS';

su -s /bin/sh -c "nova-manage db sync" nova

keystone user-create --name=nova --pass=NOVA_PASS --email=nova@example.com

keystone user-role-add --user=nova --tenant=service --role=admin

keystone service-create --name=nova --type=compute --description="Nova Compute service"

keystone endpoint-create --service-id=$(keystone service-list | awk '/ compute / {print $2}') --publicurl=http://[Controller_IP]:8774/v2/%\(tenant_id\)s --internalurl=http://[Controller_IP]:8774/v2/%\(tenant_id\)s --adminurl=http://[Controller_IP]:8774/v2/%\(tenant_id\)s

nano ~/restart.sh

#!/bin/bash

service nova-api restart

service nova-cert restart

service nova-consoleauth restart

service nova-scheduler restart

service nova-conductor restart

service nova-novncproxy restart

service nova-compute restart

service nova-network restart

chmod +x ~/restart.sh

~/restart.sh

nova-manage service list

理論上你應該會看到6個笑臉正在對你笑

這代表著是 目前所有服務正常啟動中

Day 28 Ending !


上一篇
從最底層基礎建設到軟體開發,無所不包的雲端(Openstack Day 18)
下一篇
從最底層基礎建設到軟體開發,無所不包的雲端(Openstack Day 20)
系列文
從最底層基礎建設到軟體開發,無所不包的雲端30
圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友留言

立即登入留言